﻿using AnesSystem.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace AnesSystem.Controls.Pacu.SC.SCDC
{
    /// <summary>
    /// PacuOperInfoCtrl.xaml 的交互逻辑
    /// </summary>
    public partial class PacuOperInfoCtrl : UserControl
    {
        public PacuOperInfoCtrl()
        {
            InitializeComponent();
            this.DataContext = PacuOperInfoCtrlViewModel.Instance;
            InitRadioButton();
        }


        private void CustomCheckBoxCtrl_CheckChanged(object sender, RoutedEventArgs e)
        {
            PacuOperInfoCtrlViewModel.Instance.CalTotalPoint();
        }

        private void sj_GotFocus(object sender, RoutedEventArgs e)
        {
            CusDatePickerWin cusDatePicker = new CusDatePickerWin();
            cusDatePicker.SelectedDateTime = DateTime.Now;

            cusDatePicker.ShowDialog();

            if (cusDatePicker.Result)
            {
                sj.Value = cusDatePicker.SelectedDateTime.ToString(DateFormat.DATE_FORMAT_STR_YMDHM);//2005年11月5日
            }
        }
        private void InitRadioButton()
        {
            new RadioButtonHelper().ChangeRadioSatus(qx, ss, hm);
            new RadioButtonHelper().ChangeRadioSatus(dd, bdd);
            new RadioButtonHelper().ChangeRadioSatus(dgw, dgcd, dglm);
            new RadioButtonHelper().ChangeRadioSatus(ztbw, ztby);
        }
    }
}
